import { request } from '@vipl520/utils'

// 清除缓存
export function delCache() {
  return request({
    url: '/adminapi/common/clear',
    method: 'post'
  })
}

// 获取页面模板钩子内容
export interface GetTemplateHooksParams {
  hooks: string[] // 钩子名称数组
  dkSys?: Record<string, any> // 系统参数
}

export interface TemplateHooksResponse {
  [hookName: string]: string // 钩子名称对应的内容
}

export function getTemplateHooks(params: GetTemplateHooksParams) {
  return request({
    url: '/adminapi/common/getTemplateHooks',
    method: 'get',
    params
  })
}
